define(["jquery", "easy-admin"], function ($, ea) {

    var init = {
        table_elem: '#currentTable',
        table_render_id: 'currentTableRenderId',
        index_url: 'user.level/index',
        add_url: 'user.level/add',
        edit_url: 'user.level/edit',
        delete_url: 'user.level/delete',
        export_url: 'user.level/export',
        modify_url: 'user.level/modify',
    };

    var Controller = {

        index: function () {
            ea.table.render({
                init: init,
                cols: [[
                    {type: 'checkbox'},                    {field: 'name', title: '等级名称'},                    {field: 'up_money', title: '直升金额'},                    {field: 'goods_discount', title: '直营店折扣'},                    {field: 'recharge_discount', title: '充值折扣'},                    {field: 'consume', title: '消费升级金额'},                    {field: 'ico', title: '图标', templet: ea.table.image,search:false},                    {field: 'create_time', title: '创建时间',search : 'range'},                    {field: 'is_default', search: 'select', selectList: {"1":"否","2":"是"}, title: '是否默认',templet: ea.table.switch,tips:"否|是"},                    {width: 250, title: '操作', templet: ea.table.tool},
                ]],
            });

            ea.listen();
        },
        add: function () {
            ea.listen();
        },
        edit: function () {
            ea.listen();
        },
    };
    return Controller;
});